var uploader = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
               $("#ul_pics").append(li);
                uploader.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);
            //alert(data.pic)
           // $("#" + file.id).html("<div class='img'><img src='/" + data.pic + "'/></div><p>" + data.name + "</p><br><input name='face180' type='hidden'  value='/" + data.pic + "'/>");
			//$("#" + file.id).html("<input name='' type='text'  value='" + data.pic + "'/>");

            //$("#img_pic_d").val(data.pic);
            $("#" + file.id).html("<input name='face180' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d").attr('src',data.pic); 
            $("#img_pic_h").attr('href',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader.init();


var uploader2 = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn2', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics2").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader2.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
                $("#ul_pics2").append(li);
                uploader2.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);

            $("#" + file.id).html("<input name='face1802' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d2").attr('src',data.pic); 
            $("#img_pic_h2").attr('href',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader2.init();

var uploader3 = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn3', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics3").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader3.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
                $("#ul_pics3").append(li);
                uploader3.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);

            $("#" + file.id).html("<input name='face1803' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d3").attr('src',data.pic); 
            $("#img_pic_h3").attr('href',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader3.init();


var uploader4 = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn4', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics4").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader4.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
                $("#ul_pics4").append(li);
                uploader4.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);

            $("#" + file.id).html("<input name='face1804' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d4").attr('src',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader4.init();


var uploader5 = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn5', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics5").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader5.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
                $("#ul_pics5").append(li);
                uploader5.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);

            $("#" + file.id).html("<input name='face1805' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d5").attr('src',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader5.init();


var uploader6 = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn6', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics6").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader6.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
                $("#ul_pics6").append(li);
                uploader6.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);

            $("#" + file.id).html("<input name='face1806' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d6").attr('src',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader6.init();

var uploader7 = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn7', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics7").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader7.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
                $("#ul_pics7").append(li);
                uploader7.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);

            $("#" + file.id).html("<input name='face1807' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d7").attr('src',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader7.init();

var uploader8 = new plupload.Uploader({//创建实例的构造方法
    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
    browse_button: 'btn8', // 上传按钮
    url: "/index.php/Admin/common/uploadface.html", //远程上传地址
    flash_swf_url: '/Public/plupload/Moxie.swf', //flash文件地址
    silverlight_xap_url: '/Public/plupload/Moxie.xap', //silverlight文件地址
    filters: {
        max_file_size: '5mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
        mime_types: [//允许文件上传类型
            {title: "files", extensions: "jpg,png,gif"}
        ]
    },
    multi_selection: true, //true:ctrl多文件上传, false 单文件上传
    init: {
        FilesAdded: function(up, files) { //文件上传前
            if ($("#ul_pics8").children("li").length >= 1) {
                alert("只能传上一张截图！");
                uploader8.destroy();
            } else {
                var li = '';
                plupload.each(files, function(file) { //遍历文件
                    li += "<li id='" + file['id'] + "'></li>";
                });
                $("#ul_pics8").append(li);
                uploader8.start();
            }
        },
      
        FileUploaded: function(up, file, info) { //文件上传成功的时候触发
            var data = JSON.parse(info.response);

            $("#" + file.id).html("<input name='face1808' type='hidden'  value='" + data.pic + "'/>");
            $("#img_pic_d8").attr('src',data.pic); 
        },
        Error: function(up, err) { //上传出错的时候触发
            alert(err.message);
        }
    }
});
uploader8.init();
